home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / ifont.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.3 KB  |  97 lines

  1. /* Copyright (C) 1989, 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: ifont.h,v 1.4 2000/09/19 19:00:43 lpd Exp $ */
  20. /* Interpreter internal font representation */
  21.  
  22. #ifndef ifont_INCLUDED
  23. #  define ifont_INCLUDED
  24.  
  25. #include "gsccode.h"        /* for gs_glyph, NUM_KNOWN_ENCODINGS */
  26. #include "gsstype.h"        /* for extern_st */
  27.  
  28. /* The external definition of fonts is given in the PostScript manual, */
  29. /* pp. 91-93. */
  30.  
  31. /* The structure given below is 'client data' from the viewpoint */
  32. /* of the library.  font-type objects (t_struct/st_font, "t_fontID") */
  33. /* point directly to a gs_font.  */
  34.  
  35. typedef struct font_data_s {
  36.     ref dict;            /* font dictionary object */
  37.     ref BuildChar;
  38.     ref BuildGlyph;
  39.     ref Encoding;
  40.     ref CharStrings;
  41.     union _fs {
  42.     struct _f1 {
  43.         ref OtherSubrs;    /* from Private dictionary */
  44.         ref Subrs;        /* from Private dictionary */
  45.         ref GlobalSubrs;    /* from Private dictionary, */
  46.         /* for Type 2 charstrings */
  47.     } type1;
  48.     struct _f42 {
  49.         ref sfnts;
  50.         ref CIDMap;        /* for CIDFontType 2 fonts */
  51.         ref GlyphDirectory;
  52.     } type42;
  53.     struct _fc0 {
  54.         ref GlyphDirectory;
  55.         ref GlyphData;    /* (if preloaded) string or array of strings */
  56.         ref DataSource;    /* (if not preloaded) reusable stream */
  57.     } cid0;
  58.     } u;
  59. } font_data;
  60.  
  61. /*
  62.  * Even though the interpreter's part of the font data actually
  63.  * consists of refs, allocating it as refs tends to create sandbars;
  64.  * since it is always allocated and freed as a unit, we can treat it
  65.  * as an ordinary structure.
  66.  */
  67. /* st_font_data is exported for zdefault_make_font in zfont.c. */
  68. extern_st(st_font_data);
  69. #define public_st_font_data()    /* in zbfont.c */\
  70.   gs_public_st_ref_struct(st_font_data, font_data, "font_data")
  71. #define pfont_data(pfont) ((font_data *)((pfont)->client_data))
  72. #define pfont_dict(pfont) (&pfont_data(pfont)->dict)
  73.  
  74. /* Registered encodings, for the benefit of platform fonts, `seac', */
  75. /* and compiled font initialization. */
  76. /* This is a t_array ref that points to the encodings. */
  77. #define registered_Encodings_countof NUM_KNOWN_ENCODINGS
  78. extern ref registered_Encodings;
  79.  
  80. #define registered_Encoding(i) (registered_Encodings.value.refs[i])
  81. #define StandardEncoding registered_Encoding(0)
  82.  
  83. /* Internal procedures shared between modules */
  84.  
  85. /* In zchar.c */
  86. int font_bbox_param(P2(const ref * pfdict, double bbox[4]));
  87.  
  88. /* In zfont.c */
  89. #ifndef gs_font_DEFINED
  90. #  define gs_font_DEFINED
  91. typedef struct gs_font_s gs_font;
  92. #endif
  93. int font_param(P2(const ref * pfdict, gs_font ** ppfont));
  94. bool zfont_mark_glyph_name(P2(gs_glyph glyph, void *ignore_data));
  95.  
  96. #endif /* ifont_INCLUDED */
  97.